cmake_minimum_required(VERSION 3.29)
project(dna C)
set(CMAKE_C_COMPILER "/opt/homebrew/opt/llvm/bin/clang")
set(CMAKE_C_STANDARD 11)
set(OpenMP_C_FLAGS "-fopenmp -DACCELERATE_NEW_LAPACK ")
set(OpenMP_C_LIB_NAMES "omp")
set(OpenMP_omp_LIBRARY /opt/homebrew/opt/llvm/lib/libomp.dylib)
# 定义 include 目录
include_directories(include PRIVATE /opt/homebrew/opt/llvm/include)
#link_directories(/opt/homebrew/opt/llvm/lib)
find_package(Threads REQUIRED)
# 查找 OpenMP
find_package(OpenMP REQUIRED)
add_library(dna_lib SHARED utils/list.c
        utils/utils.c
        utils/blas.c
        utils/gemm.c
        dio/image.c
        dio/data.c
        dio/matrix.c
        dstruct/box.c
        dstruct/tree.c
        conv/col2im.c
        conv/im2col.c)
target_link_libraries(dna_lib PUBLIC "-framework Accelerate" PRIVATE Threads::Threads PRIVATE OpenMP::OpenMP_C)

add_executable(dna main.c)
# 添加库源文件

target_link_libraries(dna dna_lib)
